package com.xique.blelock.view.Thtreepackage;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import org.java_websocket.drafts.Draft_10;

import java.net.URI;

/**
 * Created by yb on 2016/10/28.
 */
public class MyApplication2 extends Application {

    private static ExampleClient webSocketClient;
    private static Context context;
    @Override
    public void onCreate() {
        super.onCreate();

        try {
            webSocketClient= new ExampleClient( new URI( "ws://10.0.2.2:8887" ), new Draft_10() ); // more about drafts here: http://github.com/TooTallNate/Java-WebSocket/wiki/Drafts
            webSocketClient.connectBlocking();
            webSocketClient.send("_user_login_xzzzqscy");
        }catch (Exception e){
            Log.e("webSecket", "WebSecket连接异常" + e.getMessage());
        }

        context=getApplicationContext();
    }

    public static ExampleClient getWebSocketClient() {
        return webSocketClient;
    }




}
